﻿<?php
	include 'inc/conn.php';

	extract($_POST);
	extract($_GET);
	unset($_POST,$_GET);
	/*	if (isset($act) && isset($id))
	{
		if (empty($iReason) || empty($iPurpose) ||empty($iScheme) ||empty($iFailrate) ||empty($vContent) || empty($iOwner) 
			|| empty($iStatus)){
			echo "<script>alert('Some content must be filled in data!!');</script>";
			die("Some content must be filled in data!");
		}

		if ($act == 'mod')
		{	
			date_default_timezone_set('Asia/Shanghai');
			$dt = date("Y-m-d H:i:s");
			$db = new mysql();
			$table = "validate_issues";
			$condition = "id=".$id;
			$mod_content="val_reason=\"".htmlspecialchars($iReason)."\", val_purpose=\"".htmlspecialchars($iPurpose)."\", 
			val_scheme=\"".htmlspecialchars($iScheme)."\", val_failrate=\"".htmlspecialchars($iFailrate).
			"\", val_content=\"".htmlspecialchars($vContent)."\", val_owner=\"".htmlspecialchars($iOwner)."\", 
			val_status=\"".htmlspecialchars($iStatus)."\", reserved1=\"".$dt."\"";	
			
			$db->update($table, $mod_content, $condition);
			echo "<script>alert('Data changed!');</script>";
			$db->close();
		}
	
	}
	*/
	if (!isset($id))
	{
		echo "<script>alert('ID is empty!');</script>";
		die("ID is empty!");
	}
	$db = new mysql();
	$sql = "select * from validate_issues where id=".$id;
	$db->query($sql);
	$num = $db->db_num_rows();
	if ($num == 0)
		die("No data was found!");
	$row = $db->fetch_assoc();
?>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- <link rel="stylesheet" href="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/css/bootstrap.min.css">-->
<link rel="stylesheet" href="/css/bootstrap.min.css">
<script type="text/javascript" src="/js/jquery.min.js"></script>
<script type="text/javascript" src="/js/jquery-migrate.min.js"></script>
<script type="text/javascript" src="/xhEditor/xheditor.min.js"></script>
<script type="text/javascript" src="/xhEditor/xheditor_lang/zh-cn.js"></script>
<script type="text/javascript" src="/js/bootstrap.min.js"></script>
<title>查看 "<? echo htmlspecialchars_decode($row['val_reason']); ?>" 详细信息</title>
<script type="text/javascript">  
function goTopEx() {  
    var obj = document.getElementById("goTopBtn");  
    function getScrollTop() {  
        return document.documentElement.scrollTop + document.body.scrollTop;  
    }  
    function setScrollTop(value) {  
        if (document.documentElement.scrollTop) {  
            document.documentElement.scrollTop = value;  
        } else {  
            document.body.scrollTop = value;  
        }  
    }  
    window.onscroll = function() {  
        getScrollTop() > 0 ? obj.style.display = "": obj.style.display = "none";  
    }  
    obj.onclick = function() {  
        var goTop = setInterval(scrollMove, 10);  
        function scrollMove() {  
            setScrollTop(getScrollTop() / 1.1);  
            if (getScrollTop() < 1) clearInterval(goTop);  
        }  
    }  
}  
</script>  
<style>
	BODY {  
		HEIGHT: auto;  
	}  
	#goTopBtn {  
		POSITION: fixed; TEXT-ALIGN: center; LINE-HEIGHT: 30px; WIDTH: 30px; BOTTOM: 35px;
		HEIGHT: 33px; FONT-SIZE: 12px; CURSOR: pointer; RIGHT: 0px; _position: absolute; _right: auto  
	}  
</style>
</head>
<body class="background">
<div style="display: none" id="goTopBtn"><img border=0 src="/image/top.jpg"></div>
<script type=text/javascript>goTopEx();</script>
<?
	include "top.php";
?>
<div class="container-fluid white-background pagecontent">
<div class="panel panel-primary">
    <div class="panel-heading">
        <h3 class="panel-title">
		问题追踪系统>>查看"<? echo htmlspecialchars_decode($row['val_reason']); ?>" 详细信息 
			<? 
				if (isset($_SESSION['ID']) && $_SESSION['logchnname'] == $row['val_owner']) {
					echo "<a href='#' rel='tooltip' title='修改' onclick=\"javascript:window.open('/admin/mod_issue.php?id=${id}', '修改', 'height=860, width=1200, toolbar=no, menubar=no, scrollbars=yes, resizable=yes,location=no, status=no');\">[编辑]</a>";
				}
			?>
		</h3>
    </div>
    <div class="panel-body">
<div class="form-group">
<p>
<strong>问题描述:</strong>&nbsp;<? echo htmlspecialchars_decode($row['val_reason']); ?><br />
</p>
<p>
<strong>问题结论:</strong>&nbsp;<font color="#0000FF"><? echo htmlspecialchars_decode($row['val_rootcause']); ?></font><br />
</p>
<p>
<strong>短期对策:</strong>&nbsp;<? echo htmlspecialchars_decode($row['val_purpose']); ?><br />
</p>
<p>
<strong>长期对策:</strong>&nbsp;<? echo htmlspecialchars_decode($row['val_scheme']); ?><br />
</p>
<p>
<strong>不良状况:</strong>&nbsp;<? echo htmlspecialchars_decode($row['val_failrate']); ?><br />
</p>
<p>
<strong>分析人员:</strong>&nbsp;<? echo htmlspecialchars_decode($row['val_owner']); ?><br />
</p>
<p>
<strong>责任单位:</strong>&nbsp;<font color="#FF0000"><? echo htmlspecialchars_decode($row['val_duty']); ?></font><br />
</p>
<p>
<strong>问题状态:</strong>&nbsp;
<? 
	switch ($row['val_status']){
		case "Open":
			echo "<font color='red'>Open</font>";
			break;
		case "Tracking":
			echo "<font color='blue'>Tracking</font>";
			break;
		case "Close":
			echo "<font color='black'>Close</font>";
			break;			
	}
?>
<br/>
</p>
<p>
发现日期:&nbsp;<strong><? echo htmlspecialchars_decode($row['val_date']); ?> </strong>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
更新日期:&nbsp;<strong><? echo htmlspecialchars_decode($row['val_update']); ?> </strong> 
</p>
</div>
	<p class="text-info">详细内容：</p>
	<?	echo htmlspecialchars_decode($row['val_content']);?>
    </div>
</div>
</div>
<?
include 'bottom.php';
?>
</body>
</html>
<?
	$db->close();
?>
